package oop3;

/**
 * @author oldliu
 * @since 1.0
 */
public class Driver {
    String name;
    int age;

    public Driver(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //驾驶
    public void drive(Car c) {
        System.out.println(name + "驾驶" + c.brand);
        c.info();
        System.out.println(name + "在街上飙车");
    }

    public void drive(Bus b) {
        System.out.println(name + "开着公交车" + b.line);
        b.work();
        System.out.println("上班糊口");
    }

    public void drive(Truck t) {
        System.out.println(name + "开着货车" + t.no + "，载货赚钱");
        t.run();
        System.out.println(name + "拉货赚钱");
    }
}
